//
//  SMViewController.m
//  DiDi
//
//  Created by huangtie on 2017/2/27.
//  Copyright © 2017年 黄铁. All rights reserved.
//

#import "SMViewController.h"

#define Tag_ClassName 20161231
#define Tag_Fps 20161232
@interface SMViewController ()


@end

@implementation SMViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.edgesForExtendedLayout = UIRectEdgeNone;
    
    self.view.backgroundColor = DI_VIEWCONTROLLER_GRAY;
    
    if (self.navigationController.topViewController && self.navigationController.viewControllers.firstObject != self) {
        self.navigationItem.leftBarButtonItem = [SMHelper customBackBarItemWithTarget:self action:@selector(leftItemClick:)];
    }
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)leftItemClick:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)rightItemClick:(id)sender
{
    
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

- (BOOL)prefersStatusBarHidden {
    return NO;
}

- (BOOL)hidesBottomBarWhenPushed
{
    if (self.navigationController == self.tabBarController.selectedViewController && self.navigationController.viewControllers.count == 1) {
        return NO;
    }
    return YES;
}

- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay
{
    block = [block copy];
    
    [self performSelector:@selector(fireBlockAfterDelay:) withObject:block afterDelay:delay];
}

- (void)fireBlockAfterDelay:(void (^)(void))block
{
    block();
}

//- (BOOL)shouldAutorotate
//{
//    return NO;
//}
//
//- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
//    return UIInterfaceOrientationMaskPortrait;
//}
//
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
//    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
//}

@end
